<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/27
 * Time: 18:59
 */

namespace app\lib\Exception;


use think\Exception;

class BaseException extends Exception
{
    public $stateCode = 400;
    public $info = '参数错误';
    public $errorCode = 10000;
    public function __construct($params='')
    {
        if (!is_array($params)) {
            return;
        }

        if (key_exists('stateCode', $params)) {
            $this->stateCode = $params['stateCode'];
        }

        if (key_exists('info', $params)) {
            $this->info = $params['info'];
        }

        if (key_exists('errorCode', $params)) {
            $this->errorCode = $params['errorCode'];
        }
    }
}